package cn.iocoder.yudao.module.common.dal.mysql.knowledgepoint;

import java.util.*;

import cn.iocoder.yudao.framework.common.pojo.PageResult;
import cn.iocoder.yudao.framework.mybatis.core.query.LambdaQueryWrapperX;
import cn.iocoder.yudao.framework.mybatis.core.mapper.BaseMapperX;
import cn.iocoder.yudao.module.common.dal.dataobject.knowledgepoint.KnowledgePointDO;
import org.apache.ibatis.annotations.Mapper;
import cn.iocoder.yudao.module.common.controller.admin.knowledgepoint.vo.*;

/**
 * 知识点 Mapper
 *
 * @author 芋道源码
 */
@Mapper
public interface KnowledgePointMapper extends BaseMapperX<KnowledgePointDO> {

    default PageResult<KnowledgePointDO> selectPage(KnowledgePointPageReqVO reqVO) {
        return selectPage(reqVO, new LambdaQueryWrapperX<KnowledgePointDO>()
                .likeIfPresent(KnowledgePointDO::getPointName, reqVO.getPointName())
                .likeIfPresent(KnowledgePointDO::getCreatorName, reqVO.getCreatorName())
                .betweenIfPresent(KnowledgePointDO::getCreateTime, reqVO.getCreateTime())
                .likeIfPresent(KnowledgePointDO::getUpdaterName, reqVO.getUpdaterName())
                .eqIfPresent(KnowledgePointDO::getVersion, reqVO.getVersion())
                .orderByDesc(KnowledgePointDO::getId));
    }

}